package rd.hardcore.ui.config.content 
{
	import aze.motion.eaze;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	/**
	 * ...
	 * @author Romain
	 */
	public class BaseContent extends BaseContent_FC
	{
		
		public var id 		: String;
		public var clickbt	: MovieClip;
		public var view	: MovieClip;
		
		public function BaseContent() 
		{
			alpha = 0;
			
			title_tf.autoSize = TextFieldAutoSize.LEFT;
			
			if (clickbt)
			{
				clickbt.addEventListener(MouseEvent.ROLL_OVER, 	handleOver);
				clickbt.addEventListener(MouseEvent.ROLL_OUT, 	handleOut);
			}
		}
		
		public function build( _xml : XML ) : void
		{
			title_tf.htmlText = _xml.toString();
			id = _xml.@id;
		}
		
		private function handleOver(e:MouseEvent):void 
		{
			eaze(clickbt).to(.4, {alpha:.8 } );
		}
		
		private function handleOut(e:MouseEvent):void 
		{
			eaze(clickbt).to(.4, {alpha:1 } );
		}
		
		
		public function display() : void
		{
			eaze(this).to(.4, {alpha:1 }).onComplete(clearTween);
		}
		
		public function hide( _callBack : Function ) : void
		{
			eaze(this).to(.4, { alpha:0 } ).onComplete(_callBack);
		}
		
		private function clearTween() : void
		{
			ConfigPanelContent.isTweening = false;
		}
	}

}